<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>    
<%-- created by sunxiaoliang on 2017年9月8日 下午3:38:41--%>    
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="http://cdn.amazeui.org/amazeui/2.7.2/css/amazeui.min.css" />
<title>exam/test</title>
</head>
<body>
<div class="am-container dataDiv">
			<section class="am-panel am-panel-primary">
			  <header class="am-panel-hd">
			    <h3 class="am-panel-title">考试功能演示</h3>
			  </header>
			  <div class="am-panel-bd">
			  		<form id="checkForm">
					<table class="am-table am-table-bordered am-text-center">
						<thead>
							<tr>
								<th colspan="3">
									<button title="点击此按钮刷新下方表格数据，ajax处理" class="am-btn am-btn-primary" id="refresh">刷新数据</button>
								</th>
							</tr>
							
						</thead>
						<tbody>
						<c:forEach items="${list }" varStatus="i" var="u">
							<tr>
								<td><input type="checkbox"></td>
								<td>${u.name }</td>
								<td>${u.age }岁</td>
							</tr>
						</c:forEach>
							<tr>
								
								<td colspan="3">
									<button class="am-btn am-btn-primary" title="点击后将所有数据的checkbox修改为选中状态"  id="all">全选</button>
									<button class="am-btn am-btn-primary" title="点击后将所有数据的checkbox修改为未选中状态" id="nothing">全不选</button>
									<button class="am-btn am-btn-primary" title="点击后，已选择的checkbox改为未选择，未选择的checkbox改为已选择" id="noAll">反选</button>
									<button class="am-btn am-btn-warning" title="点击后提交已选择数据的value值" id="up">提交已选择数据</button>
								</td>
							</tr>
						</tbody>
					</table>
					</form>
					<div>
						
					</div>
			  </div>
			</section>
		</div>
		
		<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
		<script src="http://cdn.amazeui.org/amazeui/2.7.2/js/amazeui.min.js"></script>
		
		<script>
		$(function(){
			$('#refresh').click(function(){
				$(this).load('index.do');
				location.reload();
			});
			
			
			$('#all').click(function(){
				$.post("test.php", $("#checkForm").serialize());
			});
			
		});
		
		</script>
</body>
</html>